// const express = require('express')
// const app = express()
// const service = app.listen(3000)   // 执行完毕以后返回一个server服务对象

// 客户端
window.onload = function () {
  // 连接握手
  const ws = new WebSocket('wss://ech11o.websocket.org');
  ws.onopen = function () {
    alert('连接成功')
  }
  ws.onerror = function () {
    alert('连接失败')
  }
  ws.onmessage = msg => {
    console.log('11111111',msg)
    
  }
}